package com.marry.multidatasource.controller;

import com.marry.multidatasource.model.TableResItem;
import com.marry.multidatasource.model.bd.Prereginfo;
import com.marry.multidatasource.service.PrereginfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 预告登记控制器
 *
 * @author ml
 * @create 2018-01-09--14:31
 */
@RestController
public class PrereginfoController {
    @Autowired
    private PrereginfoService prereginfoService;

    @GetMapping("getPrereginfoListByRealeunum")
    public TableResItem getPrereginfoListByRealeunum(String realeunum){
        System.out.println("realeunum = [" + realeunum + "]");
        TableResItem item=new TableResItem();
        List<Prereginfo> prereginfoList=prereginfoService.getPrereginfoListByRealeunum(realeunum);
        item.setCount(prereginfoList.size());
        item.setData(prereginfoList);
        return item;


    }
}
